package fr.greta.centreFormation.bean;

import java.util.ArrayList;
import java.util.Date;

public class Candidat extends Personne{

	private Diplome diplome  = new Diplome();
	private String competence;
	private String motivation;
	private String cv;
	private Etat etat;
	private String clef;
	private ArrayList<Promotion> collectionDePromotions= new ArrayList<Promotion>();
	
	public String genererClef(){
		String chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890"; 
	    String clef = "";
	    for(int x=0;x<50;x++)
	    {
	       int i = (int)Math.floor(Math.random() * 62); 
	       clef += chars.charAt(i);
	    }
	    //System.out.println(clef);
	    return clef;
	}
	
	public void modifEtat(Etat etat){
		this.etat = etat;
	}
		
	/**
	 * 
	 */
	public Candidat(Etat etat) {
		super();
		// TODO Auto-generated constructor stub
	}
	
	public Candidat() {
		super();
	}

	/**
	 * @param idPersonne
	 * @param nom
	 * @param prenom
	 * @param mail
	 * @param numTel1
	 * @param numtel2
	 * @param dateNaissance
	 * @param adresse
	 * @param ville
	 * @param codePostale
	 * @param login
	 * @param password
	 */
	public Candidat(int idPersonne, String nom, String prenom, String mail,
			String numTel1, String numtel2, Date dateNaissance, String adresse,
			String ville, int codePostale, String login, String password) {
		super(idPersonne, nom, prenom, mail, numTel1, numtel2, dateNaissance, adresse,
				ville, codePostale, login, password);
		// TODO Auto-generated constructor stub
	}
	/**
	 * @param diplome
	 * @param competence
	 * @param motivation
	 * @param cv
	 * @param etat
	 * @param clef
	 */
	public Candidat(Diplome diplome, String competence, String motivation,
			String cv, Etat etat, String clef) {
		super();
		this.diplome = diplome;
		this.competence = competence;
		this.motivation = motivation;
		this.cv = cv;
		this.etat = etat;
		this.clef = clef;
	}
	
	/**
	 * @return the diplome
	 */
	public Diplome getDiplome() {
		return diplome;
	}
	/**
	 * @param diplome the diplome to set
	 */
	public void setDiplome(Diplome diplome) {
		this.diplome = diplome;
	}
	/**
	 * @return the competence
	 */
	public String getCompetence() {
		return competence;
	}
	/**
	 * @param competence the competence to set
	 */
	public void setCompetence(String competence) {
		this.competence = competence;
	}
	/**
	 * @return the motivation
	 */
	public String getMotivation() {
		return motivation;
	}
	/**
	 * @param motivation the motivation to set
	 */
	public void setMotivation(String motivation) {
		this.motivation = motivation;
	}
	/**
	 * @return the cv
	 */
	public String getCv() {
		return cv;
	}
	/**
	 * @param cv the cv to set
	 */
	public void setCv(String cv) {
		this.cv = cv;
	}
	/**
	 * @return the etat
	 */
	public Etat getEtat() {
		return etat;
	}
	/**
	 * @param etat the etat to set
	 */
	public void setEtat(Etat etat) {
		this.etat = etat;
	}
	/**
	 * @return the clef
	 */
	public String getClef() {
		return clef;
	}
	/**
	 * @param clef the clef to set
	 */
	public void setClef(String clef) {
		this.clef = clef;
	}

	
	/**
	 * @return the collectionDePromotions
	 */
	public ArrayList<Promotion> getCollectionDePromotions() {
		return collectionDePromotions;
	}

	/**
	 * @param collectionDePromotions the collectionDePromotions to set
	 */
	public void setCollectionDePromotions(
			ArrayList<Promotion> collectionDePromotions) {
		this.collectionDePromotions = collectionDePromotions;
	}

	/* (non-Javadoc)
	 * @see java.lang.Object#toString()
	 */
	@Override
	public String toString() {
		return "Candidat [diplome=" + diplome + ", competence=" + competence
				+ ", motivation=" + motivation + ", cv=" + cv + ", etat="
				+ etat + ", clef=" + clef + "]";
	}

	
	
	
	
	
}
